﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace ScFramework.Core
{
    /// <summary>
    /// 系统组件，由Laucher管理
    /// </summary>
    public abstract class SystemModule:ISystemModule
    {
        public Main _main;

        public virtual void Enable()
        {

        }

        /// <summary>
        /// 初始化函数
        /// </summary>
        public virtual void Initialize(Main m) 
        {
            _main = m;
        }

        /// <summary>
        /// 每帧更新
        /// </summary>
        /// <param name="deltaTime">帧间隔</param>
        public virtual void SysUpdate(float deltaTime)
        {

        }

        /// <summary>
        /// 物理每帧更新
        /// </summary>
        /// <param name="deltaTime">帧间隔</param>
        public virtual void SysFixedUpdate(float deltaTime)
        {

        }

        public virtual void SysLateFixedUpdate()
        {

        }
        /// <summary>
        /// 当程序退出时
        /// </summary>
        public virtual void Dispose()
        {

        }

        public virtual void SysLateUpdate(float deltaTime)
        {
        }
    }
    public interface ISystemModule
    {
        void Enable();

        /// <summary>
        /// 初始化函数
        /// </summary>
        void Initialize(Main m);
        /// <summary>
        /// 每帧更新
        /// </summary>
        /// <param name="deltaTime">帧间隔</param>
        void SysUpdate(float deltaTime);

        void SysLateUpdate(float deltaTime);


        /// <summary>
        /// 物理每帧更新
        /// </summary>
        /// <param name="deltaTime">帧间隔</param>
        void SysFixedUpdate(float deltaTime);

        void SysLateFixedUpdate();
        /// <summary>
        /// 当程序退出时
        /// </summary>
        void Dispose();
    }
}